package com.ilop.siteraudio;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.example.myapplication_ccc.MainActivity;
import com.ilop.siteraudio.util.StatusBarUtil;

import java.io.File;
import java.util.Arrays;

public class TestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        StatusBarUtil.setDefaultStatus(this);
        String path = "/sdcard/Record/record_20210205_11_05_48.wav";
        boolean isExists = fileIsExists(path);
        if (isExists) {
            byte[] array2 = MainActivity.userAudioRun(path);
            System.out.println(Arrays.toString(array2));
        }else {
            Toast.makeText(this, "路径下无文件", Toast.LENGTH_SHORT).show();
        }
    }

    public boolean fileIsExists(String strFile) {
        try {
            File f=new File(strFile);
            return f.exists();
        } catch (Exception e) {
            return false;
        }
    }
}